/*
	The MIT License

	Copyright (c) 2010 IFMO/GameDev Studio

	Permission is hereby granted, free of charge, to any person obtaining a copy
	of this software and associated documentation files (the "Software"), to deal
	in the Software without restriction, including without limitation the rights
	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
	copies of the Software, and to permit persons to whom the Software is
	furnished to do so, subject to the following conditions:

	The above copyright notice and this permission notice shall be included in
	all copies or substantial portions of the Software.

	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
	THE SOFTWARE.
*/

#pragma once


class	EGeometryFactory : public IGeometryFactory {
	public:
								EGeometryFactory			( void );
								~EGeometryFactory		( void );
		
		virtual ITriMesh		*CreateTriMesh			( uint format );
		virtual IScene			*CreateScene			( void );
		virtual ISceneNode		*CreateSceneNode		( void );
		virtual IAnimTrack		*CreateAnimTrack		( void );

		virtual void			ClearSceneCache			( void );		
		
		virtual IPxScene		LoadSceneFromFile		( const EString file_scene_node_path );
		virtual	IPxSceneNode	LoadSceneNodeFromFile	( const EString file_scene_node_path );
		virtual IPxTriMesh		LoadMeshFromFile		( const EString file_scene_node_path );
		virtual	IPxAnimTrack	LoadAnimTrack			( const EString anim_track_path );
		
		virtual IPxTriMesh		CreatePlane				( float size_x, float size_y, uint subdiv_x, uint subdiv_y );
		virtual IPxTriMesh		CreateCube				( float size_x, float size_y, float size_z );
		virtual IPxTriMesh		CreateCylinder			( float height, float radius, uint subdiv_axis );
		virtual IPxTriMesh		CreateSphere			( float radius, uint subdiv_axis, uint subdiv_height );
		virtual IPxTriMesh		CreateCubeFromBBox		( const EBBox &bbox );
		
	protected:
		struct scene_s {
			EString		name;
			IPxScene	scene;
		};
		
		struct anim_track_s {
			EString			name;
			IPxAnimTrack	anim_track;
		};
		
		std::vector<scene_s>			scenes;
		std::vector<anim_track_s>	anim_tracks;

	private:
		//IPxScene LoadFBXScene( EString file_scene_path );
	};
